/**
 * 比较器模块
 * License: BSD
 * Authors: Lucifer (786325481@QQ.com)
 * Copyright: Copyright (C) 2008 Lucifer. All rights reserved.
 */
module system.collections.IComparer;

/**
 * The generic interface IComparer(T) is used for comparing two objects.
 */
public interface IComparer(T)
{
    /**
     * Compare two objects.
     * The implemention of this method must return a value
     * less than zero if x is less than y, zero if x is equal to y,
     * or a value greater than zero if x is greater than y.
     * Comments: 实现此方法以便对类型 T 进行自定义排序顺序比较。
     *           <strong>给实现者的说明:</strong>
     *           允许将 null 与任何引用类型进行比较，而且不会生成异常。
     *           null 被认为小于任何非空引用。
     */
    int compare(T x, T y);
}
